<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>信息管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/js/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/js/layuiadmin/style/admin.css" media="all">
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
        <form action="{:U('/Admin/Message/Index')}" method="post" id="LAY-app-content-list" lay-filter="LAY-app-content-list">

        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">留言类型</label>
                    <div class="layui-input-inline">
                        <select name="typename" id="typename">
                            <option value="" <if condition="$typename eq ''">selected</if>>请选择留言类型</option>
                            <option value="椿林麻辣烫" <if condition="$typename eq '椿林麻辣烫'">selected</if>>椿林麻辣烫</option>
                            <option value="哦辣辣" <if condition="$typename eq '哦辣辣'">selected</if>>哦辣辣</option>
                            <option value="佐鱼佑米" <if condition="$typename eq '佐鱼佑米'">selected</if>>佐鱼佑米</option>
                            <option value="一蜀一蓉" <if condition="$typename eq '一蜀一蓉'">selected</if>>一蜀一蓉</option>
                            <option value="琪馨烫捞" <if condition="$typename eq '琪馨烫捞'">selected</if>>琪馨烫捞</option>
                            <option value="芊粉家" <if condition="$typename eq '芊粉家'">selected</if>>芊粉家</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">状态</label>
                    <div class="layui-input-inline">
                        <select name="status" id="status">
                            <option value="" <if condition="$status eq ''">selected</if>>请选择留言状态</option>
                            <option value="0" <if condition="$status eq '0'">selected</if>>审核中</option>
                            <option value="1" <if condition="$status eq '1'">selected</if>>已处理</option>

                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn layuiadmin-btn-list" lay-submit lay-filter="LAY-app-contlist-search">
                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                    </button>
                </div>
            </div>
        </div>
        <div class="layui-card-body">
                <table class="layui-table"  lay-filter="messageList"  lay-data="{page:true,id:'messageList'}">
                    <thead>
                    <tr>
                        <th lay-data="{field:'id',fixed:'left',sort:true}">序号</th>
                        <th lay-data="{field:'typename',sort:true}">分类</th>
                        <th lay-data="{field:'created_at',width:180}">留言时间</th>
                        <th lay-data="{field:'name'}">姓名</th>
                        <th lay-data="{field:'tel'}">手机</th>
                        <th lay-data="{field:'content'}">留言内容</th>
                        <th lay-data="{field:'status',sort:true}">状态</th>
                        <th lay-data="{field:'remarks'}">备注</th>
                        <th lay-data="{field:'edit',fixed:'right'}">操作</th>
                    </tr>
                    </thead>
                    <thead>
                    </thead>
                    <tbody>
                    <volist name="list" id="vo">
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.typename}</td>
                        <td>{$vo.created_at}</td>
                        <td>{$vo.name}</td>
                        <td>{$vo.tel}</td>
                        <td>{$vo.content|subtext=40}</td>
                        <td>
                            <if condition="$vo.status eq 0">
                                <span style="color:#f00">审核中</span>
                            </if>
                            <if condition="$vo.status eq 1">
                                已联系
                            </if>
                        </td>
                        <td>{$vo.remarks|subtext=40}</td>
                        <td>
                            <a class="layui-btn layui-btn-xs" href="{:U('/Admin/Message/edit',array('id'=>$vo['id']))}">修改</a>
                        </td>
                    </tr>
                    </volist>
                    </tbody>
                </table>

        </div>

        </form>
    </div>
</div>




<script src="/js/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '/js/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','table'], function(){
        var $ = layui.$,table = layui.table;

        table.init('messageList', {
            // height: 315, //设置高度
            limit: 10
        });

        $(".edit").on('click',function () {
            var id=$(this).attr("data-id");
            layer.open({
                type: 2,
                title: '留言展示',
                shadeClose: true,
                shade: 0.8,
                area: ["90%","90%"],
                offset: ["5%"],
                content:["{:U('/Admin/Message/edit',array('id'=>"+id+"))}"],

            });
        })


    });
</script>